﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Text;
using Dapper;
using DapperLinq.Helper;

namespace DapperLinq
{
    public class QuestionRepository
    {
        public async System.Threading.Tasks.Task<IEnumerable<string>> GetNames(int pageIndex, int pageSize)
        {
            var sql = @" 
SELECT Content -- DISTINCT
FROM iSchoolProduct.dbo.QuestionInfos
Order By Id 
OFFSET (@pageIndex - 1) * @pageSize rows 
fetch next @pageSize rows only
";
            return await DbHelper.Db.QueryAsync<string>(sql, new { pageIndex, pageSize});
        }
    }
}
